<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('终端型号列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var terminalTypeDatas = [[${@dict.getType('terminal_type')}]];
        var removeFlag = [[${@permission.hasPermi('terminal:model:remove')}]];
        var prefix = ctx + "terminal/model";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "终端型号",
                clickToSelect:true,
                columns: [{
                    radio: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'manuNum',
                    title: '品牌编号',
                    visible: false
                },
                {
                    field: 'manuCode',
                    title: '品牌代号'
                },
                {
                    field: 'manuName',
                    title: '品牌名称'
                },
                {
                    field: 'model',
                    title: '终端型号'
                },
                    {
                    field: 'type',
                    title: '终端类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(terminalTypeDatas, value);
                    }
                 }]
            };
            $.table.init(options);
        });
        function submitHandler(index, layero) {
            var rows = $.table.selectFirstColumns();
            if (rows.length == 0) {
                $.modal.alertWarning("请选择一条记录");
                return;
            }
            $.modal.close();
            // 父页面的变量

            parent.$('#manuName').val($.table.selectColumns("manuName"));
            parent.$('#model').val($.table.selectColumns("model"));
            parent.$('#id').val($.table.selectColumns("id"));

        }
    </script>
</body>
</html>
